1. The Field of the Invention
The present invention relates to electronic messaging and, more particularly, to using subqueues to enhance local message processing.
2. Background and Relevant Art
Computer systems and related technology affect many aspects of society. Indeed, the computer system's ability to process information has transformed the way we live and work. Computer systems now commonly perform a host of tasks (e.g., word processing, scheduling, and database management) that prior to the advent of the computer system were performed manually. More recently, computer systems have been coupled to one another and to other electronic devices to form both wired and wireless computer networks over which the computer systems and other electronic devices can transfer electronic data. As a result, many tasks performed at a computer system (e.g., voice communication, accessing electronic mail, controlling home electronics, Web browsing, and printing documents) include the exchange of electronic messages between a number of computer systems and/or other electronic devices via wired and/or wireless computer networks.
Networks have in fact become so prolific that a simple network-enabled computing system may communicate with any one of millions of other computing systems spread throughout the globe over a conglomeration of networks often referred to as the “Internet”. Such computing systems may include desktop, laptop, or tablet personal computers; Personal Digital Assistants (PDAs); telephones; or any other computer or device capable of communicating over a digital network.
In order to communicate over a network, one computing system (referred to herein as a “sending computing system”) constructs or otherwise accesses an electronic message and transmits the electronic message over a network to another computing system (referred to herein as a “receiving computing system”). The electronic message may be read by a human user as when the electronic message is an e-mail or instant message, or may be read, instead, by an application running on the receiving computing system. The electronic message may be constructed by an application running on the sending computing system with the possible assistance of a human user.
In some environments, applications communicate with one another using queued message communication. Queued communication includes mechanisms for a sending application to write a message into a sending queue, the sending queue to transfer the message to a receiving queue, and for a receiving application to read the message from the receiving queue. The queues maintain communication state outside of the communicating parties, and provide a level of indirection between them. Accordingly, queued messaging provides reliable communication between loosely coupled applications. Senders and receivers of messages use intermediary queue managers to communicate, and may independently shut down and restart and may even have non-overlapping lifetimes. Queuing also allows clients and servers to send and receive messages “at their own pace” with the queue taking up the slack at either end.
Often, a receiving computer system will publish a single receiving queue name so that other computer systems can send messages into the receiving queue. The messages can be subsequently delivered from the receiving queue to an appropriate application. In some environments, messages are moved from the receiving queue into other queues at the receiving computer system. For example, a queue manager may determine that a queued message is temporarily not processable (e.g., when the appropriate application is not available). Thus, the queue manager can move the queued message from the receiving queue into another queue so as to make other queued messages available for processing. At some later time, the queue manager can move the queued message back into the receiving queue and determined whether or not the queued message is now processable.
From time to time, it may also be necessary for a queue manager to sort messages in the receiving queue into separate groups, such as, for example, to route the messages to different processing units. However, queues are typically monolithic and do not have any organized structure. Thus, appropriate sorting of messages in a receiving queue may only be achievable by moving messages out of the receiving queue and into other queues at the receiving computer system.
It may also be that an application accesses a message and subsequently moves the message to a different queue. For example, when an application detects a poisonous message (e.g., after a specified number of failed reads or failed attempts at processing the message), the application can temporarily move the poisonous message to another queue (e.g., a poisonous message queue) so other messages in the receiving queue can continue to be processed. Then at some later time, the application can move the poisonous message back into the receiving queue and attempt to read and process the poisonous message again.
However, “move” operations can be resource intensive. For example, a move operation can cause a message to be physically moved from one memory location to another memory location.
Further, when a receiving application moves a message between queues, previously assigned identity information (the identity of the original sender) can be lost. A typical mechanism for moving a message from one queue to another queue is to “Receive” from one queue and “Send” to the other queue. However, during the message move the message typically leaves the messaging system (when Receive is called) and reenters the messaging system (when Send is called). Thus, the messaging system loses track of the message for some amount of time and treats the reentering message as a new message. Since the messaging system treats the message as a new message, it can assign the identity of the mover to the message, losing the identity of the original sender.
The removal of the message from the messaging system during the message move is problematic at least for one reason. Since the message leaves the messaging system, the Receive causes a delivery acknowledgment (“ACK”) to be sent. The original sender can receive the ACK and views the ACK as an indication that delivery guarantees have been met. That is, the ACK indicates to the sending application that the receiving application processed the message. However, if the message was transferred between queues, actual delivery to the receiving application may not have occurred. Thus, the sending application may inappropriately treat the message as processed. In response to the ACK, the sending application may remove the message from a local cache and proceed with sending other messages in a message sequence.
Unfortunately, after the receiving application moves the message back into the receiving queue and again attempts to process the message, further failures can occur. Eventually, after a specified number of failures (and potentially further moves between queues) the receiving application may inform the sending application that it could not process the message. The sending application may, in response, try to resend the message. However, since the sending application previously removed the message from cache in response to the ACK, the sending application may have no way to identify the message or access the contents of the message.
Further problems can also occur. For example, due to policy reasons (e.g., security or quota settings) a new queue may fail to accept a message from a moving queue. The new queue's failure to accept the message can cause the message to instead be moved to a dead message queue at the mover.
Therefore systems, methods, and computer program products for more efficient and more accurately acknowledged local message processing would be advantageous.